<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>随机数</title>
    <style>
        a{
            color: #c01900;
            text-decoration: none;
        }
    </style>
</head>
<body>
<a href="数字抽奖.html">数字抽奖</a>
<br/>
<br/>
<script>
    //随机数
    // alert(Math.random());//产生0-1，到不了1
    alert(Math.floor(Math.random()*10));// 0-9  到不了10
    // alert(Math.round(5.4));//round四舍五入
    // alert(Math.floor(5.9));//floor向下取整

    //产生10-20
    // alert(Math.floor(Math.random()*11)+10);
    //产生min-max
    // alert(Math.floor(Math.random()*(max-min))+min);
</script>
</body>
</html>